package com.chixing.work_05.computer;

public class Computer {
    public static void main(String[] args) {
        IntelCpu cpu = new IntelCpu();
        DmengVideoCard videoCard = new DmengVideoCard();
        Mainboard mainboard = new Mainboard(videoCard,cpu);
//        videoCard.videoRunning();
//        cpu.cpuRunning();
//        mainboard.run();
//        videoCard.videoClosing();
//        cpu.cpuClosing();
//        mainboard.close();
        new Computer().openPC(mainboard);
        new Computer().closePC(mainboard);


    }
    public void openPC(Mainboard mainboard){
        System.out.println("打开电脑");
        mainboard.getVideoCard().videoRunning();
        mainboard.getCpu().cpuRunning();
        mainboard.run();

    }
    public void closePC(Mainboard mainboard){
        System.out.println("关闭电脑");
        mainboard.getVideoCard().videoClosing();
        mainboard.getCpu().cpuClosing();
        mainboard.run();
    }
}

